'use strict';

const userDetailRules = {
  username: {
    type: 'string',
    min: 2,
  },
};

const loginRules = {
  ...userDetailRules,
  password: {
    type: 'string',
  },
};

const registerRules = {
  ...loginRules,
  phone: {
    type: 'phone',
  },
};
const addUserImage = {
  image: {
    type: 'string',
    required: true,
  },
  online: {
    type: 'int',
    required: false,
    min: 0,
    max: 1,
  },
  index: {
    type: 'int',
    required: true,
    min: 0,
  },
};

const userInfoRules = {
  userId: {
    type: "array",
    required: true
  }
}

const marryLikeRule = {
  //性别：1-男，2-女，1,2-不限
  sex: {
    type: 'string',
  },
  //最小年龄
  minAge: {
    type: 'int',
  },
  //最大年岭
  maxAge: {
    type: 'int',
  },
  //最小身高
  minHeight: {
    type: 'int',
  },
  //最高身高
  maxHeight: {
    type: 'int',
  },
  //受教育程度：1-在读，2-专科，3-本科，4-研究生，5-博士，多个用逗号连接
  educationLevel: {
    type: 'string',
    required: false,
  },
  //省，多个用逗号连接
  province: {
    type: 'string',
    required: false,
  },
  //星座，多个用逗号连接
  constellation: {
    type: 'string',
    required: false,
  },
  //当前位置（位置漫游）：经度
  longitude: {
    type: 'string',
  },
  //当前位置（位置漫游）：纬度
  latitude: {
    type: 'string',
  },
}

module.exports = {
  registerRules,
  loginRules,
  userDetailRules,
  addUserImage,
  userInfoRules,
  marryLikeRule,
};
